package mt

import (
	"babyplan/internal/common/mtb"
	"cftgo/cftf/boot/app"
	"cftgo/cftf/meta"
)

type BabyPlanCluster struct {
	mtb.BabyPlanCluster
}

type BabyPlanClusterTable struct {
	meta.Table[int32, BabyPlanCluster]
	selfConf *BabyPlanCluster
}

func (this *BabyPlanCluster) InstanceInit1() {

}

func (this *BabyPlanClusterTable) GetListenPort() int32 {
	return this.selfConf.GetHttpListenPort()
}

func (this *BabyPlanClusterTable) GetHttpListenPort() int32 {
	return this.selfConf.GetHttpListenPort()
}

func (this *BabyPlanClusterTable) StaticPostInit() {
	this.selfConf = this.GetElement(app.GetInstanceId())
	if this.selfConf == nil {
		panic("imserver集群无法读取本服配置")
	}
}
